<template>
  <view class="content">
    <view style="width: 93%">
      <uni-forms :modelValue="formData" :label-width="70">
        <uni-forms-item label="姓名" name="name">
          <uni-easyinput
            type="text"
            v-model="model.name"
            placeholder="请输入姓名"
          />
        </uni-forms-item>
        <uni-forms-item label="手机号" name="name">
          <uni-easyinput
            type="text"
            v-model="model.mobile"
            placeholder="请输入手机号"
          />
        </uni-forms-item>
        <uni-forms-item label="问题内容" name="name">
          <uni-easyinput
            type="textarea"
            v-model="model.content"
            placeholder="请输入问题内容"
          />
        </uni-forms-item>
      </uni-forms>
    </view>
    <view
      style="
        width: 60%;
        height: 70rpx;
        background-color: #0c6bff;
        color: white;
        display: flex;
        align-items: center;
        margin-top: 40rpx;
        justify-content: center;
        border-radius: 10rpx;
      "
      @click="tijiao"
      >提交反馈</view
    >
  </view>
</template>

<script>
import { api } from "@/utils/api.js";
export default {
  data() {
    return {
      model: {},
    };
  },
  onLoad() {},
  methods: {
    async tijiao() {
      let res = await api.sendFeedBack(this.model);
      // console.log(res);
      uni.showToast({
        title: res.message,
        duration: 2000,
        icon: "none",
      });
      if (res.code == 1000) {
        setTimeout(() => {
          uni.navigateBack({
            delta: 1,
          });
        }, 2000);
      }
    },
  },
};
</script>

<style scoped lang="less">
.content {
  display: flex;
  flex-direction: column;
  width: 100%;
  align-items: center;
}
::v-deep .input-padding {
  padding-left: 0px;
}
</style>
